package com.sk.cardeal.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sk.cardeal.R;
import com.sk.cardeal.entity.OutOrderDetails;

import java.util.List;

/**
 * Created by sk on 2018/3/27.
 */

public class OutOrderListAdapter extends BaseQuickAdapter<OutOrderDetails.ResultListBean, BaseViewHolder> {

    public OutOrderListAdapter(int layoutResId, @Nullable List<OutOrderDetails.ResultListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OutOrderDetails.ResultListBean item) {

        String qs = "";
        switch (item.getQuality()){
            case 1:
                qs = "原厂件";
                break;
            case 2:
                qs = "品牌件";
                break;
            case 3:
                qs = "改装件";
                break;
            case 4:
                qs = "自制件";
                break;
            case 5:
                qs = "修复件";
                break;
            case 6:
                qs = "拆车件";
                break;
        }

        helper.setText(R.id.parts_name, item.getPartName())
                .setText(R.id.tv_code, "编码：" + item.getVin())
        .setText(R.id.tv_quality,"品质："+qs)
        .setText(R.id.out_num,"出库数量："+item.getOut_number());
    }
}
